return new Date().valueOf();
export function saveCurrentHtmlAsIs() { var blob: Blob = new (<any>Blob)(['<!doctype html>\n', document.documentElement.outerHTML], { type: 'application/octet-stream' }); var url = URL.createObjectURL(blob);
var a = document.createElement('a'); a.setAttribute('download', 'nteapo.html'); var evt_ = document.createEvent("MouseEvents"); (<any>evt_).initMouseEvent("click", true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); export function addEventListener(element: any, type: string, listener: (event: Event) => void) { if (element.addEventListener) { element.addEventListener(type, listener);
var ontype = 'on' + type;
if (element.attachEvent) { element.attachEvent('on' + type, listener); else if (element[ontype]) { element[ontype] = listener;
export function addEventListenerWithDelay(element: any, type: string, listener: (event: Event) => void) { var listenerClosure = () => { addEventListener(element, type, event => { if (typeof requestAnimationFrame === 'function')
requestAnimationFrame(listenerClosure);
setTimeout(listenerClosure, 1);